﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes.sim {
    import Classes.*;
    import __AS3__.vec.*;
    import Modules.workers.*;

    public class TrainTrip {

        private var m_beginTime:int;
        private var m_duration:int;
        private var m_transactionType:String;
        private var m_isWelcomeTrip:Boolean = false;
        private var m_itemName:String;
        private var m_item:Item;
        private var m_commodityType:String;
        private var m_commodityAmount:int;
        private var m_coins:int;
        private var m_maxStops:int;
        private var m_stopIds:Vector.<String>;

        public function get beginTime():int{
            return (this.m_beginTime);
        }
        public function set beginTime(_arg1:int):void{
            this.m_beginTime = _arg1;
        }
        public function get duration():int{
            return (this.m_duration);
        }
        public function set duration(_arg1:int):void{
            this.m_duration = _arg1;
        }
        public function get timeLeft():int{
            return (Math.max(0, ((this.m_beginTime + this.m_duration) - (GlobalEngine.getTimer() / 1000))));
        }
        public function get transactionType():String{
            return (this.m_transactionType);
        }
        public function set transactionType(_arg1:String):void{
            this.m_transactionType = _arg1;
        }
        public function get isWelcomeTrip():Boolean{
            return (this.m_isWelcomeTrip);
        }
        public function set isWelcomeTrip(_arg1:Boolean):void{
            this.m_isWelcomeTrip = _arg1;
        }
        public function get itemName():String{
            return (this.m_itemName);
        }
        public function set itemName(_arg1:String):void{
            this.m_itemName = _arg1;
            this.m_item = Global.gameSettings.getItemByName(this.m_itemName);
        }
        public function get item():Item{
            return (this.m_item);
        }
        public function get commodityType():String{
            return (this.m_commodityType);
        }
        public function set commodityType(_arg1:String):void{
            this.m_commodityType = _arg1;
        }
        public function get commodityAmount():int{
            return (this.m_commodityAmount);
        }
        public function set commodityAmount(_arg1:int):void{
            this.m_commodityAmount = _arg1;
        }
        public function get coins():int{
            return (this.m_coins);
        }
        public function set coins(_arg1:int):void{
            this.m_coins = _arg1;
        }
        public function get maxStops():int{
            return (this.m_maxStops);
        }
        public function set maxStops(_arg1:int):void{
            this.m_maxStops = _arg1;
        }
        public function get stopIds():Vector.<String>{
            return (this.m_stopIds);
        }
        public function loadFromWorker(_arg1:TrainWorkers):void{
            this.itemName = _arg1.itemName;
            this.m_duration = this.m_item.trainTripTime;
            this.m_beginTime = _arg1.timeSent;
            this.m_transactionType = _arg1.operation;
            this.m_commodityType = _arg1.commodityType;
            this.m_commodityAmount = _arg1.commodity;
            this.m_coins = _arg1.coins;
            this.m_maxStops = _arg1.maxWorkers;
            this.m_stopIds = _arg1.getWorkerIds();
        }

    }
}//package Classes.sim 
